import { apiEdit, apiGetUserInfo } from "@/apis/user";
import { useUserStore } from '@/stores/user';

const edit = async (data: any = {}) => {
    let userStore = useUserStore();

    const res = await apiEdit(data);
    userStore.editUSerDetail();
    return true;
}
const detail = async () => {
    const res = await apiGetUserInfo();
    return res.data;
}
// 保存用户信息
const save = async () => {
    let userStore = useUserStore();

    const res = await apiGetUserInfo();
    userStore.setUserInfo(res);
    // return res.data;

}


export default {
    edit, detail, save
}

